home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Framewrk / FWPart / Include / FWPrHdlr.h < prev    next >
Encoding:
Text File  |  1996-04-25  |  3.5 KB  |  120 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWPrHdlr.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWPRHDLR_H
  11. #define FWPRHDLR_H
  12.  
  13. #ifndef FWEVENTH_H
  14. #include "FWEventH.h"
  15. #endif
  16.  
  17. //========================================================================================
  18. //    Forward Declarations
  19. //========================================================================================
  20.  
  21. struct Environment;
  22.  
  23. class FW_CPrintInfo;
  24. class FW_CPrintEnvironment;
  25. class FW_CFrame;
  26. class FW_CRect;
  27. class FW_CView;
  28. class FW_CPart;
  29. class FW_CString;
  30.  
  31. //========================================================================================
  32. //    class FW_CPrintHandler
  33. //========================================================================================
  34.  
  35. class FW_CPrintHandler : public FW_MEventHandler
  36. {
  37. //----------------------------------------------------------------------------------------
  38. //    Constructors/Destructor
  39. //
  40. public:
  41.     FW_CPrintHandler(FW_CPart* part, FW_CFrame* frame);
  42.     virtual    ~FW_CPrintHandler();
  43.  
  44. //----------------------------------------------------------------------------------------
  45. //    Inherited API
  46. //
  47. public:
  48.     virtual FW_Boolean             DoAdjustMenus(Environment *ev, FW_CMenuBar* menuBar, FW_Boolean hasMenuFocus, FW_Boolean isRoot);
  49.     virtual FW_Boolean             DoMenu(Environment* ev, const FW_CMenuEvent& theMenuEvent);
  50.  
  51. //----------------------------------------------------------------------------------------
  52. //    New API
  53. //
  54. // ----- Overridables - printing
  55. protected:
  56.     virtual    FW_Boolean            IsCurrentlyPrintable(Environment* ev) const;
  57.     virtual void                GetPrintContentExtent(Environment* ev, FW_CPoint& extent) const;
  58.     virtual void                PrintPage(Environment* ev, ODFacet* facet, const FW_CRect& pageBounds, long xPage, long yPage);
  59.  
  60. // ----- Overridables - dialogs
  61. public:
  62.     virtual void                CreateProgressDialog(
  63.                                     Environment*        ev,
  64.                                     ODFrame*            frame,
  65.                                     long                numPages,
  66.                                     const FW_CString&    title);
  67.  
  68.     virtual void                DestroyProgressDialog(
  69.                                     Environment*        ev,
  70.                                     ODFrame*            frame);
  71.  
  72.     virtual void                UpdateProgressDialog(
  73.                                     long                pageNumber);
  74. protected:
  75.  
  76.     virtual FW_Boolean            DoPageSetupDialog(Environment* ev);
  77.     virtual FW_Boolean            DoJobDialog(Environment* ev);
  78.     virtual void                NotifyNoDefaultPrinter(Environment* ev);
  79.     virtual void                NotifyPrintingCanceled(Environment* ev);
  80.  
  81.  
  82. public:    
  83. // ----- Operations
  84.     void                        HandlePageSetup(Environment* ev);
  85.     void                        HandlePrint(Environment* ev);
  86.                                     
  87. // ----- Attributes
  88.     FW_CPart*                    GetPart() const;
  89.     FW_CFrame*                    GetFrame() const;
  90.     FW_CView*                    GetPrintView() const;
  91.                                 
  92. // ----- Overridables - printing
  93. protected:
  94.     virtual void                GetPrintJobTitle(Environment* ev, FW_CString& jobTitle) const;
  95.  
  96.     virtual FW_CView*            CreatePrintView(Environment* ev);
  97.     virtual void                ReleasePrintView(Environment* ev);
  98.  
  99.     virtual    void                PrintDocument(Environment* ev, FW_CPrintEnvironment* printEnv);
  100.     virtual void                CountPrintPages(Environment* ev, long& xPageCount, long& yPageCount);
  101.  
  102. // ----- Helpers
  103.     FW_Boolean                    PreModalDialog(Environment* ev);                                    
  104.     void                        PostModalDialog(Environment* ev);
  105.  
  106. private:
  107.     FW_CPrintInfo*                GetPrintInfo() const;                            
  108.  
  109. //----------------------------------------------------------------------------------------
  110. //    Data Members
  111. //
  112. private:
  113.     FW_CPart*                    fPart;
  114.     FW_CFrame*                    fFrame;
  115.     FW_CView*                    fPrintView;
  116. };
  117.  
  118. #endif
  119.  
  120.